<?php

	 $db_host = 'localhost';
	 $db_user = 'function';
	 $db_pwd = 'w9ak4X1l0Y';

	 $database = 'function_a5110060';

	 $table = 'login_details';

	$con = mysql_connect($db_host, $db_user, $db_pwd);
	if (!$con)
	die("Can't connect to database");
	mysql_select_db($database,$con);

	$userName = $_REQUEST['username'];
	$password = $_REQUEST['password'];

	//echo("Name: :".$userName);
	//echo("password: :".$password);
	 
	$sql="select password from {$table} where user_name = '".$userName."'";
	//echo("Sql :".$sql);
	$result=mysql_query($sql);
	$arrayResult = mysql_fetch_array($result);

		if($password == $arrayResult['password']){
			header("Location: ../Home.html");	
		}else{
			header("Location: ../index.html");
		}
	
	
?> 